Skip to content

Fix repo-consistency agent fetching oldest PRs instead of most recently merged#65

Merged
Malcolmnixon merged 4 commits intomainfrom
copilot/improve-repo-consistency-agent
Mar 24, 2026
Merged

Fix repo-consistency agent fetching oldest PRs instead of most recently merged#65
Malcolmnixon merged 4 commits intomainfrom
copilot/improve-repo-consistency-agent

Conversation

Copy link
Contributor

Copilot AI commented Mar 24, 2026

Pull Request

Description

The repo-consistency agent was retrieving the 20 oldest merged PRs (e.g., #1–20) from the template repository instead of the most recent ones, due to no sort order being specified in the search query. GitHub's search API defaults to returning results in ascending order when no sort is provided.

Fix: Add sort:updated-desc to the merged PR search query and update the wording to "the 20 most recently merged PRs" so the agent instructions clearly reflect the intended behavior.

- Fetch the last 20 merged PRs (`is:pr is:merged`) from ...
+ Fetch the 20 most recently merged PRs (`is:pr is:merged sort:updated-desc`) from ...

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement

Related Issues

Pre-Submission Checklist

Before submitting this pull request, ensure you have completed the following:

Build and Test

  • Code builds successfully: dotnet build --configuration Release
  • All unit tests pass: dotnet test --configuration Release
  • Code produces zero warnings

Code Quality

  • Code formatting is correct: dotnet format --verify-no-changes
  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • All linters pass: ./lint.sh (Unix/macOS) or cmd /c lint.bat / ./lint.bat (Windows)

Testing

  • Added unit tests for new functionality
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated ARCHITECTURE.md (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

sort:updated-desc is used as the closest available proxy for merge recency, since GitHub's search API does not support a sort:merged qualifier. Merging a PR always updates its updated_at timestamp, making sort:updated-desc the best available approximation for ordering by most recently merged. The wording has been updated to "the 20 most recently merged PRs" to clearly express the intent alongside the sort qualifier used.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix repo consistency agent to grab latest PRs Fix repo-consistency agent fetching oldest PRs instead of latest Mar 24, 2026
Copilot AI requested a review from Malcolmnixon March 24, 2026 12:12
@Malcolmnixon
Copy link
Contributor

@copilot Would the wording be better with "the most recent 20" and also using the sorting order?

Copy link
Contributor Author

Copilot AI commented Mar 24, 2026

@copilot Would the wording be better with "the most recent 20" and also using the sorting order?

Updated in a109a9b — changed "the last 20" to "the most recent 20" while keeping the sort:updated-desc in the query.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/1108766/chrome-linux.zip
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node install.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Fix repo-consistency agent fetching oldest PRs instead of latest Fix repo-consistency agent fetching oldest PRs instead of most recent Mar 24, 2026
@Malcolmnixon Malcolmnixon marked this pull request as ready for review March 24, 2026 12:21
Copilot AI review requested due to automatic review settings March 24, 2026 12:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the repo-consistency agent instructions to ensure it retrieves a recent set of merged PRs from the TemplateDotNetLibrary template repo, avoiding GitHub search’s default ordering behavior.

Changes:

  • Add sort:updated-desc to the merged PR search query in the agent instructions.
  • Update the wording from “the last 20” to “the most recent 20” merged PRs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor Author

Copilot AI commented Mar 24, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/1108766/chrome-linux.zip
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node install.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Fix repo-consistency agent fetching oldest PRs instead of most recent Fix repo-consistency agent fetching oldest PRs instead of most recently merged Mar 24, 2026
Copilot AI requested a review from Malcolmnixon March 24, 2026 12:28
@Malcolmnixon Malcolmnixon merged commit 1d977e8 into main Mar 24, 2026
6 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/improve-repo-consistency-agent branch March 24, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants